﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PJRScrum
{
    public partial class ImportGuiPanelTwo : ImportGuiPanel
    {
        Image gekozenImage;
        public ImportGuiPanelTwo()
        {
            InitializeComponent();
            buttonPlattegrondInladen.Click += new EventHandler(buttonPlattegrondInladen_Click);
        }

        /// <summary>
        /// laad plattegrond in op panel3 en stuurt door naar view
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonPlattegrondInladen_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd1 = new OpenFileDialog();
            ofd1.Title = "Selecteer een afbeelding";
            ofd1.InitialDirectory = "c:\\";
            ofd1.Filter = "Afbeeldingen ( *.jpg *.jpeg *.gif *.png)| *.jpg; *.jpeg *.gif *.png";
            if (ofd1.ShowDialog() == DialogResult.OK)
            {
                gekozenImage = Image.FromFile(ofd1.FileName.ToString());
                pictureBoxPlattegrond.Image = gekozenImage;
            }
        }

        public Image GetImage()
        {
            return gekozenImage;
        }

        public override bool Finished
        {
            get
            {
                return gekozenImage != null;
            }
        }
    }
}
